package site.shihuan.helpdesk.service.manager;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import site.shihuan.helpdesk.service.dao.SvcClerkDao;
import site.shihuan.helpdesk.service.model.Constants;
import site.shihuan.helpdesk.service.model.po.SvcClerkPO;

import java.util.List;

/**
 * 客服人员
 *
 * @author 周世焕
 * @Date 2021/3/3 15:23
 */
@Component
@Slf4j
public class ClerkManager {

    @Autowired
    private SvcClerkDao clerkDao;

    public void changeOnlineStatus(String clerkId,String status) {
        SvcClerkPO clerkPO = new SvcClerkPO();
        clerkPO.setClerkId(clerkId);
        clerkPO.setOnline(status);
        clerkDao.updateByPrimaryKeySelective(clerkPO);
    }

    public List<String> findOnlineClerkIds(String tenantId) {
        return clerkDao.selectOnlineClerkIds(tenantId);
    }
}
